package com.example.yoho.mvp.view.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.yoho.R;
import com.example.yoho.domain.Domain_Url;
import com.example.yoho.mvp.model.entity.RecommendEntity;
import com.example.yoho.utils.MyGlide;

import java.util.List;

public class MyRecommendAdapter extends BaseQuickAdapter<RecommendEntity.RecommendValues, BaseViewHolder> {
    String url="http://169.254.88.63/yoho/";
    public MyRecommendAdapter(int layoutResId, @Nullable List<RecommendEntity.RecommendValues> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, RecommendEntity.RecommendValues item) {

        TextView textView_reconedname=helper.getView(R.id.recound_name);
        ImageView imageView_reconed_image=helper.getView(R.id.recound_image);
        textView_reconedname.setText(item.recommend_name);
        MyGlide.GlideFor(mContext, Domain_Url.IMAGE_URL+item.recommend_url,imageView_reconed_image);
    }
}
